#include <stdio.h>
#include "pthread_once.h"
#include <pthread.h>
#include <unistd.h>
#include <sys/syscall.h>


#define THREAD_NUM 5

void *thread_func(void *arg)
{
    pid_t id = get_thread_id();

    printf("thread%d starts\n", id);
    obj_create();
}

int main() {
    pthread_t threads[THREAD_NUM];
    int i, ret;

    for (i = 0; i < THREAD_NUM; ++i) {
        pthread_create(&threads[i], NULL, thread_func, (void *)i);
    }

    for (i = 0; i < THREAD_NUM; ++i) {
        pthread_join(threads[i], NULL);
    }

    return 0;
}
